<html lang="zh"><head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,inital-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta name="apple-wap-web-app-capable" content="yes">
<meta name="apple-wap-web-app-status-bar-style" content="black-translucent">
<title>佩奇网</title>
	
<script>
  var store_price=138.00;
  var goods_inventory=100;
</script>

<link href="css/style.css" rel="stylesheet" type="text/css">
	<script src="js/jquery-1.10.2.min.js"></script>
	<script src="js/TouchSlide.1.1.js"></script>
	<script src="js/jquery.validate.min.js"></script>
	<script>
		var goods_cod = "0";
		jQuery(document).ready(function() {
			//初始化数据
			var data='[]';
			if(data!=""){
			    var properties=eval("("+data+")");
			    jQuery.each(properties,function(index,item){
			        jQuery(".goodsintro").append("<li>"+item.name+":"+item.val+"</li>");
			    });
			}
			  
			//
			jQuery("#log_cur a").click(function(){
			   jQuery(this).parent().parent().find(".goods_ct").show();
			});
			//
			jQuery(".titleback>a").click(function(){
			   jQuery(".Cities").hide();
			   jQuery(".goods_ct").hide();
			   //jQuery(this).parent().parent().parent().hide();
			});
			//
			jQuery(".item a").click(function(){
			   jQuery(".Cities").hide();								 
			   jQuery(this).parent().find(".Cities").show();
			});
			//
			jQuery(".Cities>ul>li>a").click(function(){
			  var city_name=jQuery(this).attr("city_name");	
			  jQuery.ajax({type:'POST',url:'http://192.168.172.122:8081/trans_fee.htm',dataType:'json',data:{"city_name":city_name,"goods_id":"98454"},
						   beforeSend:function(){
							    jQuery("#current_city_info").html('<img style="padding-top:3px;" src="http://192.168.172.122:8081/resources/style/common/images/wait.gif" width="14" height="14" />');
							    jQuery("#goods_mail_fee").html('<img style="padding-top:3px;" src="http://192.168.172.122:8081/resources/style/common/images/wait.gif" width="14" height="14" />');
								jQuery("#goods_express_fee").html('<img style="padding-top:3px;" src="http://192.168.172.122:8081/resources/style/common/images/wait.gif" width="14" height="14" />');
								jQuery("#goods_ems_fee").html('<img style="padding-top:3px;" src="http://192.168.172.122:8081/resources/style/common/images/wait.gif" width="14" height="14" />');				
							},
						   success:function(json){
							    jQuery("#current_city_info").html(json.current_city_info);
							    jQuery("#goods_mail_fee").html('¥'+json.mail_fee);
								jQuery("#goods_express_fee").html('¥'+json.express_fee);
								jQuery("#goods_ems_fee").html('¥'+json.ems_fee);
							 }
						  });
			  jQuery(".Cities").hide();	
			  jQuery(".goods_ct").hide();
			});
			
			<!--商品中自定义的规格值赋值-->

			<!--商品中自定义的规格值赋值结束-->
		});
		jQuery(function() {
			jQuery("#show_spec").click(function(e) {
				if (jQuery("#spec_select").css("display") == "block") {
					jQuery("#img_spec").attr("src", "http://192.168.172.122:8081/resources/style/system/front/wap/images/details_right.gif");
					jQuery("#img_spec").attr("width", "9");
					jQuery("#img_spec").attr("height", "18");
					
				} else {
					jQuery("#img_spec").attr("src", "http://192.168.172.122:8081/resources/style/system/front/wap/images/details_right_b.gif");
					jQuery("#img_spec").attr("width", "18");
					jQuery("#img_spec").attr("height", "9");
					
				}
				jQuery("#spec_select").toggle();
			});
			
			jQuery("#show_num").click(function(e) {
					if (jQuery("#spec_count").css("display") == "block") {
						jQuery("#img_spec").attr("src", "http://192.168.172.122:8081/resources/style/system/front/wap/images/details_right.gif");
						jQuery("#img_spec").attr("width", "9");
						jQuery("#img_spec").attr("height", "18");
						if (goods_cod == "0") {
							jQuery("#show_count").html("x" + jQuery("#count").val() + "&nbsp&nbsp");
						} else {
							jQuery("#show_count").html("x" + jQuery("#count").val());
						}
					} else {
						jQuery("#img_spec").attr("src", "http://192.168.172.122:8081/resources/style/system/front/wap/images/details_right_b.gif");
						jQuery("#img_spec").attr("width", "18");
						jQuery("#img_spec").attr("height", "9");
						if (goods_cod == "0") {
							jQuery("#show_count").html("x" + jQuery("#count").val() + "&nbsp&nbsp");
						} else {
							jQuery("#show_count").html("x" + jQuery("#count").val());
						}

					}
					jQuery("#spec_count").toggle();
			});
			
			jQuery("#show_introduce").click(function(e) {
				if (jQuery("#goods_introduce").css("display") == "block") {
					jQuery("#img_spec").attr("src", "http://192.168.172.122:8081/resources/style/system/front/wap/images/details_right.gif");
					jQuery("#img_spec").attr("width", "9");
					jQuery("#img_spec").attr("height", "18");
					
				} else {
					jQuery("#img_spec").attr("src", "http://192.168.172.122:8081/resources/style/system/front/wap/images/details_right_b.gif");
					jQuery("#img_spec").attr("width", "18");
					jQuery("#img_spec").attr("height", "9");
					
				}
				jQuery("#goods_introduce").toggle();
			});

			jQuery(".details_standard>a").click(function() {
				jQuery(".standard_bottom").slideToggle();
				if (jQuery(this).find("ul").is(".standard_active")) {
					jQuery(this).find("ul").removeClass("standard_active");
				} else {
					jQuery(this).find("ul").addClass("standard_active");
				}
			})
			jQuery(".standard_check").not(":eq(0)").each(function() {
				var th = jQuery(this).find("a").first();
				goods_spec_set(th);
			});
			//商品收藏
			jQuery(".details_star").click(function() {
					if (jQuery(".details_star img").attr("mark") == 0) {
						jQuery.post("/add_goods_favorite.htm",
							{"id" : "53"},
							function(data) {
								if (data == 0) {
									var img = "/resources/style/system/front/wap/images/star.png";
									jQuery(".details_star img").attr("src", img);

									jQuery(".details_star img").attr("mark", "1");
								} else if (data == 1) {
									alert("您已收藏该商品");
								}

							}, "text");
					}
				});
		});
		<!--end-->
		
		//添加购物车
		function add_cart() {
							 var add=true;
				 var gsp="";
				 if(jQuery(".colordate").length==0){
				    add=true;
				 }else{
					jQuery(".colordate").each(function(){
					   jQuery.each(jQuery(this).find("a[class=this]"),function(){
						  gsp=jQuery(this).attr("gsp")+","+gsp; 
					   });
				       if(jQuery(this).find("a[class=this]").length==0) 
				    	   add=false;
					});
				 } 
				 var count=jQuery("#count").val();
				 if(count==0){
				    add=false;
					alert("至少购买一件商品!");
					return;
				 }
				 if(goods_inventory==0){
				    add=false;
					alert("商品库存为0,不能购买!");
					return;
				 }
				 if(add){
					var count = jQuery("#count").val() - 0;
					var goods_inventory = jQuery("#goods_inventory").attr("inventory") - 0;
					if (goods_inventory != 0) {
						if (goods_inventory < count) {
							count = goods_inventory;
						}
						jQuery.ajax({
									type : 'POST',
									url : 'http://192.168.172.122:8081/add_goods_cart.htm',
									data : {
										"id" : "98454",
										"gsp" : gsp,
										"count" : count,
										"price":store_price
									},
									success : function(data) {
										var result=eval("("+data+")");  
										if("false"==result.flag){
											alert("多个卖家的商品无法同时加入购物车结算");
										}else{
											window.location.href = "http://192.168.172.122:8081/goods_cart1.htm";
										}
										jQuery("#cart_goods_count").html(result.count);
										jQuery("#cart_goods_totalprice").html(data.total_price);
										jQuery(".goodscar").fadeIn();
									    time_id=window.setInterval(cart_fadeOut,1000);
									}
						});
					}
				 }else{
					jQuery("#spec_select").show();
					jQuery("#goods_spec_chose").show();
				 }
					}
		//直接购买
		function buy_goods() {
							  var add=true
				  var gsp="";
				  if(jQuery(".colordate").length==0){
				    add=true;
				  }else{
					jQuery(".colordate").each(function(){
					   jQuery.each(jQuery(this).find("a[class=this]"),function(){
						  gsp=jQuery(this).attr("gsp")+","+gsp; 
					   });
				       if(jQuery(this).find("a[class=this]").length==0) add=false;
					});
				  }
				  var count=jQuery("#count").val();
				  if(count==0){
				    add=false;
					alert("至少购买一件商品!");
					return;
				  }
				  if(goods_inventory==0){
				    add=false;
					alert("商品库存为0,不能购买!");
					return;
				  }    
				  var buy_type=arguments[0];
				  if(add){
					  var count = jQuery("#count").val() - 0;
				  	  var goods_inventory = jQuery("#goods_inventory").attr("inventory") - 0;
					  if (goods_inventory != 0) {
						  if (goods_inventory < count) {
								count = goods_inventory;
						  }
						  jQuery.ajax({
								type : 'POST',
								url : 'http://192.168.172.122:8081/add_goods_cart.htm',
								data : {
									"id" : "98454",
									"gsp" : gsp,
									"count" : count,
									"price":store_price,
									"buy_type":buy_type
								},
								success : function(data) {
									var result=eval("("+data+")");  
									if("false"==result.flag){
										alert("多个卖家的商品无法同时加入购物车结算");
									} else {
										window.location.href = "http://192.168.172.122:8081/goods_cart1.htm";
									}
									jQuery("#cart_goods_count").html(result.count);
								}
							});
						}
				  }else{
					jQuery("#spec_select").show();
					jQuery("#goods_spec_chose").show();
				  }
					}
	</script>
</head>

<body class="index_relative">
	<div class="phone_hd">
		<a class="back" href="javascript:history.go(-1);"><img src="img/返回.png" width="25" height="25"></a> 团购商品
	</div>
	
	<!--团购商品-->
	<div class="Group_purchase">
		<div class="Group_purchasebox">
			<div>本次团购时间:</div>
			<div>往期团购&gt;</div>
		</div>
		<div class="Group_purchase_time">
			<span>2018-01-01</span>
			<span>08:00</span>
			<span>至</span>
			<span>2018-01-01</span>
			<span>08:00</span>
		</div>
	</div>
	
	<!--商品-->
	<div class="background">
		<div class="Group_purchase_shop">
			<div class="Group_purchase_shopbox">
				<div><img src="img/yuner.JPG"/></div>
				<div class="Group_purchase_title">
					<span>团购</span>
					<span>啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊</span>
				</div>
				<div class="Group_purchase_cash">
					<span>￥</span>
					<span>68.00</span>
					<span>7.1</span>
					<span>折</span>
				</div>
				<div class="Group_purchase_buy">
					<p>
						<span>￥</span>
						<span>180</span>
					</p>
					<p>
						<span>已购买</span>
						<span>n</span>
						<span>人</span>
					</p>
				</div>
			</div>
			
			<div class="Group_purchase_shopbox">
				<div><img src="img/yuner.JPG"/></div>
				<div class="Group_purchase_title">
					<span>团购</span>
					<span>啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊</span>
				</div>
				<div class="Group_purchase_cash">
					<span>￥</span>
					<span>68.00</span>
					<span>7.1</span>
					<span>折</span>
				</div>
				<div class="Group_purchase_buy">
					<p>
						<span>￥</span>
						<span>180</span>
					</p>
					<p>
						<span>已购买</span>
						<span>n</span>
						<span>人</span>
					</p>
				</div>
			</div>

			<div class="Group_purchase_shopbox">
				<div><img src="img/yuner.JPG"/></div>
				<div class="Group_purchase_title">
					<span>团购</span>
					<span>啊啊啊啊啊啊啊啊啊啊啊啊啊啊啊</span>
				</div>
				<div class="Group_purchase_cash">
					<span>￥</span>
					<span>68.00</span>
					<span>7.1</span>
					<span>折</span>
				</div>
				<div class="Group_purchase_buy">
					<p>
						<span>￥</span>
						<span>180</span>
					</p>
					<p>
						<span>已购买</span>
						<span>n</span>
						<span>人</span>
					</p>
				</div>
			</div>
		</div>
	</div>

<script type="text/javascript">
	
//	选项卡
	function xuanxiang(){
		var lis = document.querySelectorAll(".navqianggoubox >ul >li");
		var div = document.querySelectorAll(".div");
		for(let i=0;i<lis.length;i++){
			lis[i].addEventListener("click",function(){
				for(var j=0;j<lis.length;j++){
					div[j].classList.remove("divblock");
					lis[j].classList.remove("navcolor");
				}
				div[i].classList.add("divblock");
				lis[i].classList.add("navcolor");
			})
		}
	}
	xuanxiang()
	
	//	倒计时
	function time(){//64800+3120
		var the_s = 67920;//定义剩余时间, 必须用时间戳.单位为秒
		setInterval(promote,1000);//每秒执行一次下面的函数
		function promote() {
		    var d = Math.floor((the_s / 3600) / 24);
		    var g = Math.floor((the_s - d * 24 * 3600) / 3600);
		    var e = Math.floor((the_s - d * 24 * 3600 - g * 3600) / 60);
		    var f = (the_s - g * 3600) % 60;
		    if(f<10){
		    	f='0'+f
		    }
		    var html =  "<strong>距结束</strong><b>" + g + "</b><span>:</span><b>" + e + "</b><span>:</span><b>" + f + "</b>";
		    document.getElementById("load").innerHTML = html;//这个id是你想要显示的div的id
		    the_s--;
		}
	}
	time()
</script>

